<?php

namespace Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;

use App\Models\MemberAddress;

class MemberAddressFactory extends Factory
{

    protected $model = MemberAddress::class;

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        $addresses = [
          ['湖南省','长沙市','岳麓区'],
          ['湖北省','武汉市','武昌区'],
          ['广东省','深圳市','福田区'],
          ['北京市','直辖市','东城区'],
          ['河北省','石家庄市','长安区']
        ];

        $address = $this->faker->randomElement($addresses);

        return [
            'province' => $address[0],
            'city'     => $address[1],
            'district' => $address[2],
            'address'  => sprintf('第%d街道第%d号',$this->faker->randomNumber(2),$this->faker->randomNumber(3)),
            'zip'      => $this->faker->randomNumber(7),
            'contact_name' => $this->faker->titleMale,
            'contact_phone' => $this->faker->phoneNumber
        ];
    }
}
